Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent TOML invalidation by pirates of T[elements...] #39252

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Jan 14, 2021

StaticArrays (perhaps among others) semi-pirates this method,
although they've worked hard to make it pretty innocuous.
Still, there are times when it invalidates the TOML-reading,
so best to protect this.

@timholy timholy added the backport 1.6 Change should be backported to release-1.6 label Jan 14, 2021
Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tim! :)

It may be worth considering adding comments for these types of transformations, such that those who come later don't revert the rewrites, not understanding the upside of the more complex forms.

StaticArrays (perhaps among others) semi-pirates this method,
although they've worked hard to make it pretty innocuous.
Still, there are times when it invalidates the TOML-reading,
so best to protect this.
@timholy
Copy link
Sponsor Member Author

timholy commented Jan 14, 2021

Done.

Copy link
Sponsor Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, I just assumed I improved the risk of invalidations when I modified this part last time.. Thanks for fixing this !

@KristofferC KristofferC merged commit 985dfa5 into master Jan 15, 2021
@KristofferC KristofferC deleted the teh/toml_invalidations branch January 15, 2021 06:48
@@ -657,13 +657,20 @@ end
#########

function push!!(v::Vector, el)
# Since these types are typically non-inferrable, they are a big invalidation risk,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic comment! :)

# Since these types are typically non-inferrable, they are a big invalidation risk,
# and since it's used by the package-loading infrastructure the cost of invalidation
# is high. Therefore, this is written to reduce the "exposed surface area": e.g., rather
# than writing `T[el]` we write it as `push!(Vector{T}(undef, 1), el)` so that there
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit, but push!(Vector{T}(undef, 1), el) should be push!(Vector{T}(undef, 0), el) or the version in the code, right?

@KristofferC KristofferC mentioned this pull request Jan 19, 2021
60 tasks
KristofferC pushed a commit that referenced this pull request Jan 19, 2021
StaticArrays (perhaps among others) semi-pirates this method,
although they've worked hard to make it pretty innocuous.
Still, there are times when it invalidates the TOML-reading,
so best to protect this.

(cherry picked from commit 985dfa5)
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Feb 1, 2021
KristofferC pushed a commit that referenced this pull request Feb 1, 2021
StaticArrays (perhaps among others) semi-pirates this method,
although they've worked hard to make it pretty innocuous.
Still, there are times when it invalidates the TOML-reading,
so best to protect this.

(cherry picked from commit 985dfa5)
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
…9252)

StaticArrays (perhaps among others) semi-pirates this method,
although they've worked hard to make it pretty innocuous.
Still, there are times when it invalidates the TOML-reading,
so best to protect this.
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
…9252)

StaticArrays (perhaps among others) semi-pirates this method,
although they've worked hard to make it pretty innocuous.
Still, there are times when it invalidates the TOML-reading,
so best to protect this.
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
StaticArrays (perhaps among others) semi-pirates this method,
although they've worked hard to make it pretty innocuous.
Still, there are times when it invalidates the TOML-reading,
so best to protect this.

(cherry picked from commit 985dfa5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants